home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_300
/
352_01
/
vecrect.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1991-04-22
|
628b
|
35 lines
// VECRECT.CPP
// routines for rect 2 polar conversion.
// applies to complex vectors.
#include <stdlib.h>
#include "wtwg.h"
#include "dblib.h"
#include "vector.h"
void ToRect ( complex& z )
{
z=polar(real(z), imag(z));
};
void CVector::ToRect ( void )
{
if ( !ispolar ) return;
int vn = x.n;
float *xv = x.v;
float *yv = y.v;
complex rect;
while ( --vn >= 0 );
{
rect = polar (*xv, *yv);
*(xv++) = real (rect);
*(yv++) = imag(rect);
}
ispolar = OFF;
return; // CVector::ToRect ()
}
// ----------------- end of VECRECT.CPP -------------------------